<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页 - 个人选股系统 V5.87</title>
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">
    <script src="../static/js/jquery-1.12.4.min.js"></script>
    <script src="../static/js/bootstrap.min.js"></script>
    <script>
        $(document).ready(function () {

            $("input[name='toAdd']").each(function () {
                var currentAdd = $(this);
                currentAdd.click(function () {
                    code = $(this).attr("systemIdVaule");

{#                    alert("/add/" + code + ".html");#}
                    $.get("/add/" + code + ".html", function (data, status) {
                        alert("数据: " + data + "\n状态: " + status);
                    });
                });
            });
        });

    </script>
    <style>
        #page {
            margin: 20px auto;
            color: #666;
            display: block;
            text-align: center;
        }

        #page li {
            display: inline-block;
            min-width: 30px;
            height: 28px;
            cursor: pointer;
            color: #666;
            font-size: 13px;
            line-height: 28px;
            background-color: #f9f9f9;
            border: 1px solid #dce0e0;
            text-align: center;
            margin: 0 4px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }

        .xl-nextPage,
        .xl-prevPage {
            width: 60px;
            color: #0073A9;
            height: 28px;
        }

        #page li.xl-disabled {
            opacity: .5;
            cursor: no-drop;
        }

        #page li.xl-active {
            background-color: #0073A9;
            border-color: #0073A9;
            color: #FFF
        }
    </style>


</head>

<body ontouchstart="" onmousemove="">
<div class="navbar navbar-inverse navbar-static-top ">
    <div class="container">
        <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target="#mymenu">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="#" class="navbar-brand">选股系统</a>
        </div>
        <div class="collapse navbar-collapse" id="mymenu">
            <ul class="nav navbar-nav">
                <li class="active"><a href="">股票信息</a></li>
                <li><a href="/center.html">个人中心</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container">

    <div class="container-fluid">

        <table class="table table-hover">
            <tr>
                <th>序号</th>
                <th>股票代码</th>
                <th>股票简称</th>
                <th>涨跌幅</th>
                <th>换手率</th>
                <th>最新价(元)</th>
                <th>前期高点</th>
                <th>前期高点日期</th>
                <th>添加自选</th>
            </tr>
            {#            {%content%}#}


        {% for b in stock_data %}
        <tr>

            <td>{{ b.id }}</td>
            <td>{{ b.code }}</td>
            <td>{{ b.short }}</td>
            <td>{{ b.chg }}</td>
            <td>{{ b.turnover }}</td>
            <td>{{ b.price }}</td>
            <td>{{ b.highs }}</td>
            <td>{{ b.time }}</td>
            <td>
                <input type="button" value="修改" id="toAdd" name="toAdd" onclick="location.href='http://127.0.0.1:8000/edit.html/?id='+{{ b.id }}">
            </td>
        </tr>
        {% endfor %}
        </table>
    </div>
</div>
<div id="page"></div>




</body>

{#<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>#}
<script type="text/javascript" src="../static/jsjs/xlPaging.js"></script>
<script>
    // xlPaging.js 使用方法
    $("#page").paging({
        nowPage: {{ num }}, // 当前页码
        pageNum: 10, // 总页码
        buttonNum: 7, //要展示的页码数量
        callback: function (num) { //回调函数
            location.href='/index.html/?page='+num;
            console.log(num);
        }
    });
</script>
</html>            
